import java.util.Scanner;

public class Demo4 {
    public static Scanner scanner = new Scanner(System.in);
    public static int outTrue() {
        int[] tmp = new int[5];
        for (int i = 0; i < 5; i++) {
            tmp[i] = scanner.nextInt();
        }
        int x = tmp[4];
        int[] arr1 = new int[tmp[0]];
        cur(arr1,arr1.length);
        int a1True = com(arr1,x);
        int[] arr2 = new int[tmp[1]];
        cur(arr2,arr2.length);
        int a2True = com(arr1,x);
        int[] arr3 = new int[tmp[2]];
        cur(arr3,arr3.length);
        int a3True = com(arr1,x);
        int[] arr4 = new int[tmp[3]];
        cur(arr4,arr4.length);
        int a4True = com(arr1,x);
        return Math.min(Math.min(a1True,a2True),Math.min(a3True,a4True));
    }

    private static int com(int[] arr, int x) {
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > x){
                count ++;
            }
        }
        return count;
    }

    private static void cur(int[] arr, int length) {
        for (int i = 0; i < length; i++) {
            arr[i] = scanner.nextInt();
        }
    }

    public static void main(String[] args) {
        System.out.println(outTrue());
    }
}
